"""application URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include, re_path
from django.views.static import serve
from django.conf import settings
from django.conf.urls.static import static
from apps.generate_secret.views import AppSecretViews, AppSecretCreateViews
from apps.keys_management.views import RootKeyViews
from apps.derive_keys_management.views import DeriveKeyViews, DeriveKeyStatusViews



urlpatterns = [
    path('admin/', admin.site.urls),
    # path('api/bank_sys/', include('apps.bank_sys.urls')),
    path('api/generate_secret/', include('apps.generate_secret.urls')),
    path('api/keys_management/', include('apps.keys_management.urls')),
    path('api/derive_keys_management/', include('apps.derive_keys_management.urls')),
    # 添加根级别的generateSecret路由
    # path('api/v1/sym-encryption/app/generateSecret', AppSecretViews.as_view(), name="根级别生成应用签名token"),
    path('api/v1/sym-encryption/app/generateSecret', AppSecretCreateViews.as_view(), name="根级别生成应用签名token"),
    # 添加根级别的generateRoot路由
    path('api/v1/sym-encryption/keys/generateRoot', RootKeyViews.as_view(), name="根级别生成根密钥"),
    # 添加根级别的派生密钥管理路由
    path('api/v1/sym-encryption/keys/generateDerive', DeriveKeyViews.as_view(), name="根级别生成派生密钥"),
    path('api/v1/sym-encryption/keys/search', DeriveKeyViews.as_view(), name="根级别查询派生密钥"),
    path('api/v1/sym-encryption/keys/disable', DeriveKeyStatusViews.as_view(), name="根级别禁用派生密钥"),
    path('api/v1/sym-encryption/keys/enable', DeriveKeyStatusViews.as_view(), name="根级别启用派生密钥"),
    
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

